'use strict'

const path = require('path')

module.exports = {
  context: path.resolve(__dirname, '../'),
  entry: './src/main/index.ts',
  output: {
    path: path.join(__dirname, '../dist/main'),
    // libraryTarget: 'commonjs2',
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        loader: 'ts-loader'
      }
    ]
  },
  resolve: {
    extensions: ['.js', '.vue', '.json', '.ts'],
    alias: {
      '@': resolve('src')
    }
  },
  target: 'electron-main'
}

function resolve (dir) {
  return path.join(__dirname, '..', dir)
}
